<?php use_helper('I18N') ?>
<?php slot('on_sidebar', array('signin' => true, 'category_list' => true)) ?>
<?php slot('title', $post->getTitle()) ?>
<?php slot('keywords', $post->getMetaK()) ?>
<?php slot('description', $post->getMetaD()) ?>
<div class="post">
  <h2><?php echo $post->getHeader() ?></h2>
  <div class="post-text"><?php echo $post->getRawValue()->getText() ?></div>
  <?php include_partial('post_about', array('post'=>$post)) ?>
</div>

<div class="comments">
<a name="comments"></a>
<?php foreach ($post->getComments() as $comment): ?>
<div class="comment">
  <div class="comment-data">
    <span class="autor"><?php echo $comment->getUserName() ?></span>
    <span><?php echo $comment->getDateTimeObject('created_at')->format('j-m-Y H:i') ?></span>
    <span><?php echo link_to('#', $sf_context->getRawValue()->getRouting()->getCurrentInternalUri().'#id'.$comment->getId(), array('absolute' => true, 'title' => 'Ссылка на комментарий')) ?><span>
    <a name="id<?php echo $comment->getId() ?>"></a>
  </div>
  <div class="comment-text"><?php echo $comment->getText() ?></div>
</div>
<?php endforeach; ?>
</div>

<?php if($sf_user->isAuthenticated()): ?>
<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>
<div id="add-comment">
  <form action="<?php echo url_for('@blog_add_comment?category='.$post->getCategoryUrl().'&slug='.$post->getName()) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
   <?php echo $form ?>
   <input type="submit" value="<?php echo __('Save')?>" />
  </form>
</div>
<?php else:?>
<!-- noindex -->Для добавления комментария необходимо <?php echo link_to('Войти', '@sf_guard_signin', array('rel'=>'nofollow')) ?> или <?php echo link_to('Зарегистрироваться', '@sf_guard_register', array('rel'=>'nofollow'))?><!-- /noindex -->
<?php endif; ?>